package com.yeung.exam;

import java.util.Scanner;

public class 小Q开宝箱 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int bs = sc.nextInt();
        int ks = sc.nextInt();
        int bInd = 0;
        int[] boxs = new int[bs];
        int keys[] = new int[ks];
        int kInd = 0;
        while (bInd < bs) {
            boxs[bInd++] = sc.nextInt();
        }
        while (kInd < ks) {
            keys[kInd++] = sc.nextInt();
        }
        //开始计算
        int result = 0;
        for (int box : boxs) {
            for (int key : keys) {
                int sum = box + key;
                if (sum % 2 != 0) {
//                    不是奇数,不能开锁
                    result++;
                }

            }
        }
        System.out.println(result);

    }
}
